Skip to content

fix: use Node 24 and remove registry-url for npm OIDC publishing#175

Merged
LiranCohen merged 1 commit into
mainfrom
fix/npm-oidc-publish
Mar 4, 2026
Merged

fix: use Node 24 and remove registry-url for npm OIDC publishing#175
LiranCohen merged 1 commit into
mainfrom
fix/npm-oidc-publish

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

Fixes the npm trusted publishing failure introduced in #174. The publish step was failing with E404 Not Found / Access token expired or revoked.

Root causes:

  1. Node 22 ships npm 10.x — trusted publishing requires npm CLI 11.5.1+ (Node 24 ships npm 11+)
  2. registry-url in setup-node creates an .npmrc containing //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} — since NODE_AUTH_TOKEN was removed in chore: switch npm publish to OIDC trusted publisher #174, npm uses an empty token instead of auto-detecting the OIDC environment for trusted publishing

Changes:

  • Bump node-version from '22' to '24'
  • Remove registry-url from setup-node (npm defaults to registry.npmjs.org anyway)

Build, test, and lint all pass.

Node 22 ships npm 10.x which does not support OIDC trusted publishing
(requires npm 11.5.1+). Node 24 ships npm 11+.

The registry-url param in setup-node creates an .npmrc with
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}. Since no
NODE_AUTH_TOKEN is set (we removed it in #174), npm uses an empty
token instead of auto-detecting the OIDC environment. Removing
registry-url lets npm default to registry.npmjs.org and perform
OIDC token exchange correctly.
@LiranCohen LiranCohen merged commit f6b848e into main Mar 4, 2026
4 checks passed
@LiranCohen LiranCohen deleted the fix/npm-oidc-publish branch March 4, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant